-- GENERATED SPELL FOR [Skeletal Executioner] --


function spell0_1787(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15496,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1787', 667, 1)
end

function spell1_1787(pUnit, Event) --@Execute,n/a--
pUnit:FullCastSpellOnTarget(7160,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1787', 0, 1)
end

function spell2_1787(pUnit, Event) --@Strike,n/a--
pUnit:FullCastSpellOnTarget(12057,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1787', 644, 1)
end

function Sorts_1787(pUnit, Event)
local choix_sorts_1787 = math.random(0, 2)
if choix_sorts_1787 == 0 then
pUnit:RegisterEvent('spell0_1787', 1, 1)
end
if choix_sorts_1787 == 1 then
pUnit:RegisterEvent('spell1_1787', 1, 1)
end
if choix_sorts_1787 == 2 then
pUnit:RegisterEvent('spell2_1787', 1, 1)
end
end

function mob1787_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1787', math.random(1500, 3000), 1)
end

function mob1787_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1787_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1787_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1787, 1, 'mob1787_Action')
RegisterUnitEvent(1787, 2, 'mob1787_Leave')
RegisterUnitEvent(1787, 3, 'mob1787_Kill')
RegisterUnitEvent(1787, 4, 'mob1787_Die')
